﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NHibernate;
using Thaire.Investment.BL;
using Thaire.Investment.BL.Filter;
using Thaire.Investment.Common;
using Thaire.Investment.Repository;

namespace TestSql
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            using (ISession session = SessionManager.SessionFactory.OpenSession())
            {
              //  new InstructionBL(session).InstructionGetSelectionData(new Thaire.Investment.BL.ScreenData.InstructionFormScreenData() { FinancialInstrument="2" });
               // new InstructionBL(session).SearchInstructionDTO(new  SearchInstructionFilter  { CompanyID = 1 });

                new InstrumentBL(session).GetRatingHistory(5, "FIXINCOMESECURITIES"); 
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            var val = (decimal)Calculator.IRRPerDay((decimal)324629508.07, (decimal)329000000, (decimal)2.7 / (decimal)100, new DateTime(2013, 10, 31), new DateTime(2013,5, 2));
        }

        private void button3_Click(object sender, EventArgs e)
        {
            var data = Calculator.CalTime2Mature(new DateTime(2016, 2, 21),new DateTime(2014, 8, 22));
             //select convert(decimal(10,2), datediff(month, '2014-08-22','2014-09-22') / 12.0) 

        }
    }
}
